<template>
  <div class="header-container">
    <h3>李昊雨's 后台管理系统</h3>
    <button class="btn btn-primary btn-sm" @click="onLogout">退出登录</button>
  </div>
</template>

<script>
export default {
  name: 'MyHeader',
  methods: {
    onLogout() {
      localStorage.removeItem('token')
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>
.header-container {
  position: fixed;
  width: 100%;
  height: 50px;
  line-height: 50px;
  top: 0;
  left: 0;
  padding: 5px 20px;
  justify-content: space-between;
  border-bottom: 1px solid #efefef;
  background-color: #fff;
  z-index: 999;
  display: flex;
  h3 {
    color: rgb(0, 123, 255);
  }
}
</style>